<template>
  <div :class="pageName">
      <div class="form">
            <el-form :inline="true" :model="searchForm" class="demo-form-inline">
                <el-form-item label="审批人">
                    <el-input v-model="searchForm.user" placeholder="审批人"></el-input>
                </el-form-item>
                <el-form-item label="活动区域">
                    <el-select v-model="searchForm.region" placeholder="活动区域">
                    <el-option label="区域一" value="shanghai"></el-option>
                    <el-option label="区域二" value="beijing"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="onSubmit">查询</el-button>
                    <el-button type="primary" @click="onAdd">新建</el-button>
                </el-form-item>
            </el-form>
      </div>
      <div class="form-body">
          <el-table
            :data="tableData.dataList"
            border
            style="width: 100%">
            <el-table-column
                prop="createTime"
                label="日期"
                width="180">
            </el-table-column>
            <el-table-column
                prop="name"
                label="姓名"
                width="180">
            </el-table-column>
            <el-table-column
                prop="phone"
                label="手机">
            </el-table-column>
            <el-table-column label="操作">
                <template slot-scope="scope">
                    <el-button
                    size="mini"
                    @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
                    <el-button
                    size="mini"
                    type="danger"
                    @click="handleDelete(scope.$index, scope.row)">删除</el-button>
                </template>
            </el-table-column>
        </el-table>
        <div class="clearfix pt15">
            <div class="fr">
                <el-pagination
                    background
                    layout="total, prev, pager, next"
                    :total="tableData.total"
                    :page-size="10"
                    :current-page="tableData.currentPage"
                    @current-change="currentChange">
                </el-pagination>
            </div>
        </div>
      </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex';
import pageMixin from "@/mixins/pageMixin";

export default {
    mixins: [pageMixin],

    data () {
        return {
            searchForm: {
                user: '',
                region: ''
            },
            pageName: 'user'
        }
    },

    computed: {
        ...mapGetters({
            tableData: `user/tableData`
        })
    },

    created () {
        
    },

    methods: {
        
    }
}
</script>

<style >

</style>
